package com.zmm.zebulon.module.trade.biz.service.aftersale;

import com.zmm.zebulon.module.trade.biz.convert.aftersale.AfterSaleLogConvert;
import com.zmm.zebulon.module.trade.biz.dal.bo.aftersale.AfterSaleLogCreateReqBO;
import com.zmm.zebulon.module.trade.biz.dal.dataobject.aftersale.AfterSaleLogDO;
import com.zmm.zebulon.module.trade.biz.dal.mysql.aftersale.AfterSaleLogMapper;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;

import javax.annotation.Resource;
import java.util.List;

/**
 * description: 交易售后日志 Service 实现类
 *
 * @author zebulon
 * package com.zmm.zebulon.module.trade.biz.service.aftersale
 * name: AfterSaleLogServiceImpl
 * date 2025/9/4 14:30
 */
@Service
@Validated
public class AfterSaleLogServiceImpl implements AfterSaleLogService {

    @Resource
    private AfterSaleLogMapper afterSaleLogMapper;

    @Override
    public void createAfterSaleLog(AfterSaleLogCreateReqBO createReqBO) {
        AfterSaleLogDO afterSaleLog = AfterSaleLogConvert.INSTANCE.convert(createReqBO);
        afterSaleLogMapper.insert(afterSaleLog);
    }

    @Override
    public List<AfterSaleLogDO> getAfterSaleLogList(Long afterSaleId) {
        return afterSaleLogMapper.selectListByAfterSaleId(afterSaleId);
    }
}
